package com.cn.bukeManage.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.springframework.ui.Model;

import com.cn.bukeManage.pojo.AccessoriesType;
import com.cn.bukeManage.pojo.Activity;
import com.cn.bukeManage.pojo.Composition;
import com.cn.bukeManage.pojo.FinishProductType;
import com.cn.bukeManage.pojo.Location;
import com.cn.bukeManage.pojo.Picture;
import com.cn.bukeManage.pojo.Sample;
import com.cn.bukeManage.pojo.Sample_location;
import com.cn.bukeManage.pojo.Sample_style;
import com.cn.bukeManage.pojo.Style;
import com.cn.bukeManage.pojo.Supplier;
import com.cn.bukeManage.pojo.Territory;
import com.cn.bukeManage.pojo.page.Page;
import com.cn.bukeManage.pojo.page.SamplePage;

public interface ShoppingmallDao {
	//分页得到所有商品信息
	public List<SamplePage> getAllGoodsByPage(SamplePage page);
	//得到所有配件类型
	public List<AccessoriesType> getAllAccTyp();
	//得到所有成品帘类型
	public List<FinishProductType> getAllFinType();
	//得到所有风格的关系表
	public List<Sample_style> getAllStyle();
	//得到所有行数（总共多少行）
	public Integer getAllRowsOfSample(SamplePage page);
	//分页得到所有活动页面
	public List<Activity> getAllActivityByPage(Page page);
	//得到活动的所有行数（总共多少行）
	public Integer getAllRowsOfActivity();
	//分页得到所有的风格
	public List<Style> getAllStyleByPage(Page page);
	//得到所有风格的行数（总共多少行）
	public Integer getAllRowsOfStyle();
	//分页得到所有的场景
	public List<Location> getAllLocationByPage(Page page);
	//得到场景的所有行数
	public Integer getAllRowsOfLocation();
	//分页查询所有区域
	public List<Territory> getAllTerritoryByPage(Page page);
	//区域的所有行数
	public Integer getAllRowsOfTerritory();
	//通过类型或者序列号来查询分页信息
	public List<SamplePage> getAllGoodsByPageAndType(SamplePage page);
	//通过type得到商品所有的行数
	public Integer getAllRowsOfSampleByType(SamplePage page);
	//通过id得到活动信息
	public Activity getActivityById(Integer activityId);
	//通过id修改活动名字和状态
	public Integer updateActivity(Activity activity);
	//添加活动
	public Integer addActivity(Activity activity);
	//通过id得到风格信息
	public Style getStyleById(Integer styleId);
	//通过id修改风格内容
	public Integer updateStyle(Style style);
	//添加风格
	public Integer addStyle(Style style);
	//通过id修改场景信息
	public Location getLocationById(Integer locationId);
	//通过id修改场景内容
	public Integer updateLocation(Location location);
	//添加场景
	public Integer addLocation(Location location);
	//通过id删除场景
	public Integer deleteLocation(Integer locationId);
	//查询是否有产品和适用场景绑定
	public Integer selectBLocation(Integer locationId);
	//查询是否有产品和风格绑定
	public Integer selectBStyle(Integer styleId);
	//删除风格
	public Integer deleteStyle(Integer styleId);
	//鍒犻櫎娲诲姩
	public Integer deleteActivity(Integer activityId);
	//娣诲姞鏍峰搧
	public void insertSample(Sample sample);
	//鑾峰緱鍏ㄩ儴椋庢牸
	public List<Style> getAllStyleS();
	//鑾峰緱鍏ㄩ儴瀹夎浣嶇疆
	public List<Location> getAllLocationS();
	//瀛樺晢鍝侀鏍�
	public int insertStyle(Map<String, Object> map);
	//瀛樺晢鍝佷娇鐢ㄥ満鏅�
	public void insertLocation(Map<String, Object> map);
	//鏌ョ郴鍒椾功
	public Integer selectSeries();
	//鎻掑叆璇︽儏鍥�
	public int insertDetailsImg(Map<String, Object> map);
	
	//娣诲姞渚涘簲鍟�
	public void insertsupplier(Supplier supplier);
	
	//插入面料使用方式
	public void insert_compositions(Composition composition);
	
	//鏌ヨ鍟嗗搧绫诲瀷
	public List<String> select_serialnumber();
	
	//鏍规嵁鍟嗗搧Id鏌ヨsample
	public Sample getSampleBySampleId(Map<String, Object> map);
	
	//鏍规嵁id鏌ヨ渚涘簲鍟�
	public Supplier selectsupplierbyid(Integer supplier);
	
	//鏍规嵁鍟嗗搧Id鏌ヨ闈㈡枡浣跨敤鏂瑰紡
	public List<Composition> findCompositionBySampleId(Integer sampleId);
	
	//鏍规嵁鍟嗗搧Id鏌ヨ椋庢牸浣跨敤鏂瑰紡
	public List<Sample_style> getAllsample_stylebysampleId(Integer sampleId);
	
	//鏍规嵁鍟嗗搧Id鏌ヨ椋庢牸浣跨敤鏂瑰紡
	public List<Sample_location> getAllsample_locationbysampleId(Integer sampleId);
	
	//鏍规嵁id鍒犻櫎渚涘簲鍟�
	public void  deletesupplierbyid(Integer supplier);
	
	//鏍规嵁Id淇敼鍟嗗搧鏁版嵁
	public void updateSamplebyId(Sample sample);
	
	//鏍规嵁id鍒犻櫎璇︾粏鍥剧墖
	public void deleteDetailsImg(Integer sampleId);
	
	//鏍规嵁sampleId鍒犻櫎椋庢牸涓棿琛ㄧ殑淇� 
	public void delete_sample_style(Integer sampleId);
	
	//鏍规嵁sampleId鍒犻櫎閫傜敤鍦烘櫙涓棿琛ㄧ殑淇� 
	public void delete_sample_location(Integer sampleId);
	
	//鏍规嵁sampleId鍒犻櫎闈㈡枡浣跨敤鏂瑰紡 
	public void delete_composition(Integer sampleId);
	//根据id查询详情图
	public List<Picture> findPicBySampleId(Integer sampleId);
	//鏍规嵁sampleId淇敼璇︽儏鍥�
	public void updateDetailsImgBySampleId(Picture picture);
	//通过商品Id查询商品信息
	public Sample selectSampleBySampleId(Integer sampleId);
	//通过类型查询商品分页信息
	public List<SamplePage> findGoodsbyType(SamplePage sample);
	//修改上下架状态  state
	public void updateGoodsByStateAndSampleId(@Param("sampleId")Integer sampleId,@Param("state")Integer state);
	
	public List<SamplePage> getGoodsByPage(SamplePage page);
	
	public List<SamplePage> getGoodsByPageAndType(SamplePage page);
	
	public void deleteSampleById(Integer sampleId);
	//通过sampleId删除布料
	public void deleteCompositionById(Integer sampleId);
	//通过SampleId删除详情图片
	public void deletePictureById(Integer sampleId);
	
	public List<SamplePage> findAllGoodsbyType(SamplePage sample);

	public Integer getRowsOfSampleByType(SamplePage page);
	//删除布料根据type
	public void deleteCompositionByType(@Param("sampleId")Integer sampleId,@Param("type")Integer type);
	
}